package com.ruoyi.common.core.page;

import java.io.Serializable;

import com.ruoyi.common.utils.StringUtils;

/**
 * 分页数据
 * 
 * @author ruoyi
 */
@SuppressWarnings("serial")
public class PageQO implements Serializable
{
	
    /** 当前记录起始索引 */
    private Integer pageNum=1;

    /** 每页显示记录数 */
    private Integer pageSize=10;

    /** 排序列 */
    private String orderByColumn;

    /** 排序的方向desc或者asc */
    private String isAsc = "asc";

    /** 分页参数合理化 */
    private Boolean reasonable = true;
    
    private Boolean Pagination = true;

	public PageQO() {
//        this.setPageNum(1);
//        this.setPageSize(10);
//        this.setOrderByColumn("");
//        this.setIsAsc("");
//        this.setReasonable(true);
    }

    public String getOrderBy()
    {
        if (StringUtils.isEmpty(orderByColumn))
        {
            return "";
        }
        return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
    }

    public Integer getPageNum()
    {
        return pageNum;
    }

    public void setPageNum(Integer pageNum)
    {
        this.pageNum = pageNum;
    }

    public Integer getPageSize()
    {
        return pageSize;
    }

    public void setPageSize(Integer pageSize)
    {
        this.pageSize = pageSize;
    }

    public String getOrderByColumn()
    {
        return orderByColumn;
    }

    public void setOrderByColumn(String orderByColumn)
    {
        this.orderByColumn = orderByColumn;
    }

    public String getIsAsc()
    {
        return isAsc;
    }

    public void setIsAsc(String isAsc)
    {
        this.isAsc = isAsc;
    }

    public Boolean getReasonable()
    {
        if (StringUtils.isNull(reasonable))
        {
            return Boolean.TRUE;
        }
        return reasonable;
    }

    public void setReasonable(Boolean reasonable)
    {
        this.reasonable = reasonable;
    }
    
    public Boolean isPagination() {
		return Pagination;
	}

	public void setPagination(Boolean pagination) {
		Pagination = pagination;
	}

}
